# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ruby-dry-cli
_gemname=${pkgname#ruby-}
pkgver=1.2.0
pkgrel=2
pkgdesc='General purpose Command Line Interface (CLI) framework for Ruby.'
arch=('any')
url='https://rubygems.org/gems/dry-cli'
license=('MIT')
depends=('ruby')
source=("https://rubygems.org/gems/$_pkgname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
sha512sums=('73c50e78e1a790c792536fb4bef72152968629a69b710acb077ca7427a14106b6007dcd8a43ab723cf6ff2c99d60b533e9018fbd2e4577c9f31c6e1df0bd4925')

package() {
  _gemhome="$(gem env home)"

  gem install --ignore-dependencies --no-user-install --no-document \
    -i "$pkgdir/$_gemhome" -n "$pkgdir/usr/bin" "$_gemname-$pkgver.gem"

  rm "$pkgdir/$_gemhome/cache/$_gemname-$pkgver.gem"

  install -Dm 644 "$pkgdir/$_gemhome/gems/$_gemname-$pkgver/LICENSE" \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

